Plotly Asiignment

elkrasa

9/11/2021

Historical rates for USD - RUB. 10 September 2021-1 April 2005.

#Load plotly package

## Warning: package 'plotly' was built under R version 4.0.5
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 4.0.5
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
## Warning: package 'readxl' was built under R version 4.0.5

##load csv with historical rates for USD - RUB.

Data<-read_excel("Excelrates.xlsx", sheet= "Exchange rates")
Data$Date <- as.Date(Data$Date)

#Building a plot

p <- plot_ly(data = Data, x = ~Date, y = ~RUB, color = ~RUB, type="bar") %>% layout(title = "Historical rates for USD - RUB", xaxis=list(title="Date",range = c('2005-04-01','2021-09-10')), yaxis=list(title="USD-RUB",range=c(20:85)))
p
## Warning: textfont.color doesn't (yet) support data arrays

## Warning: textfont.color doesn't (yet) support data arrays